import { createSlice } from "@reduxjs/toolkit";

export type cinemaList = {
    cinemaId: number, // 影院id
    title: string, // 影院名称
    price: { n: string, q: string; }, // 价格
    location: string, // 地址
    distance: string, // 距离
    services: { text: string, code: string; }[], // 服务
    discount: { card: string, text: string; };
};


export const cinemaListSlice = createSlice({
    name: 'cinemaList',
    initialState: {
        cinemaList: [] as cinemaList[],
    },
    reducers: {
        setCinemaList: (state, action) => {
            state.cinemaList = action.payload;
        }
    }
});

export const { setCinemaList } = cinemaListSlice.actions;

export default cinemaListSlice.reducer;